projects
/
gpsbabel.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
86d76e5
)
Make rtrim work sensibly when passed null pointers or pointers to empty
author
robertl
<robertl>
Tue, 3 Jun 2003 18:14:29 +0000
(18:14 +0000)
committer
robertl
<robertl>
Tue, 3 Jun 2003 18:14:29 +0000
(18:14 +0000)
strings.
util.c
patch
|
blob
|
history
diff --git
a/util.c
b/util.c
index 52cfb4c19144f62ec1262cc6285bd501d858dd83..06656b4e0c3fea952e68e07a38980aadd416a2da 100644
(file)
--- a/
util.c
+++ b/
util.c
@@
-194,6
+194,10
@@
pstrdup(char *src)
void
rtrim(char *s)
{
+ if (!s || !*s) {
+ return;
+ }
+
while (*s) {
s++;
}